<script setup>
import { useRouter } from 'vue-router'

const router = useRouter();
let fun = (id, language) => {
  // router.push(`/detail/${id}/${language}`)
  router.push({path: `/detail/${id}/${language}`})
}

</script>

<template>
  <div>
    <input type="button" @click="fun(1, 'Java')" value="编程式路由路径传参" />
    <hr>
    <router-view></router-view>
    
  </div>

</template>

<style scoped>
</style>
